﻿<UserControl x:Class="Sesa.Desktop.Common.LayoutItem"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:common="clr-namespace:Sesa.Desktop.Common"
             Margin="3"
             >
    <UserControl.ContentTemplate>
            <DataTemplate>
              <Grid>
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="Auto" SharedSizeGroup="Label"/>
                  <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                  <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <TextBlock VerticalAlignment="Center" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type common:LayoutItem},Mode=FindAncestor},Path=Label}" Margin="3"/>
                <ContentControl Content="{Binding}" Grid.Column="1" VerticalContentAlignment="Center" HorizontalContentAlignment="Stretch"/>
              </Grid>
            </DataTemplate>
    </UserControl.ContentTemplate>
</UserControl>
